package cn.itcast.bos.Dao.take_delicery;

import cn.itcast.bos.domain.take_delivery.Promotion;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;


import java.util.Date;

public interface PromotionDao extends JpaRepository<Promotion,Integer>,JpaSpecificationExecutor<Promotion> {

    @Query("update Promotion set status='2' where endDate<?1 and status='1'")
    @Modifying
    void updata(Date date);
}
